<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body><table border="1">
  <caption>用户列表</caption>
  <tr><th>用户名</th><th>密码</th><th>昵称</th></tr>
</table>
<script>
  let arr = [{username:"tom",password:"123466",nickname:"汤姆"},{username:"tom",password:"123466",nickname:"汤姆"},{username:"tom",password:"123466",nickname:"汤姆"}];

  let table = document.querySelector("table");
  for (let p of arr) {
    let tr = document.createElement("tr");
    let usernameTd = document.createElement("td");
    let passwordTd = document.createElement("td");
    let nicknameTd = document.createElement("td");

    usernameTd.innerText = p.username;
    passwordTd.innerText = p.password;
    nicknameTd.innerText = p.nickname;
    tr.append(usernameTd, passwordTd, nicknameTd);
    table.append(tr);
  }




</script>

</body>
</html>